window.exerciseIndex = new Vue({
    el: '#exerciseIndex',
    data() {
        return{
            isPast:false,
            pastData:[],//
            pageStr:'',
            currentPage:'',
        }
    },
    created() {

    },
    mounted() {

    },
    methods: {
        showPast(){
            this.isPast = true;
            this.getData(1);
        },
        getData(page){
            let that = this;
            $.get('/cn/exercise/get-exercise-record',{
                page:page?page:1,
            },function (res) {
                if(res.code == 1){
                    that.pastData = res.data;
                    that.pageStr = res.page_total;
                    that.currentPage = res.page;
                }else {
                    alert(res.message);
                }
            },'json');
        },
        prev(page){
            if(page>1){
                this.getData(parseInt(page)-1);
            }
        },
        next(page){
            if(page<this.pageStr){
                this.getData(parseInt(page)+1);
            }
        },
    }
});